package cn.itcast.Thread_03;
import java.time.*;
import java.sql.Date;

//演练线程休眠
public class SleepTask implements Runnable {

    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName()+"------"+i+new Date(1000));
            //让线程休息一miao
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
